@extends('blog.layouts.default')

@section('content')

  <header class="detail-bg">
    @include('blog.layouts.navbar')
    <div class="heading">
      <div class="tags">
        @foreach ($post->tags as $tag)
          <a href="{{ route('tags', $tag->name) }}">{{ $tag->name }}</a>
        @endforeach
      </div>
      <h1>{{ $post->title }}</h1>
      <span>Published on {{ $post->publish_date }}</span>
    </div>
  </header>

  <div class="detail-content container">

    <div class="row">
      <div class="col-md-9">
        <div class="detail-body">
          {!! $post->body !!}
        </div>

        <div class="page hr">
          @if ($previous_post)
            <a href="{{ route('detail', $previous_post->slug) }}" class="pull-left" title="{{ $previous_post->title }}">Previous</a>
          @endif
          @if ($next_post)
            <a href="{{ route('detail', $next_post->slug) }}" class="pull-right" title="{{ $next_post->title }}">Next</a>
          @endif
        </div>
      </div>
      <div class="col-md-3">
        <nav data-spy="affix" data-offset-top="600" class="sidenav">
          {!! $post->toc !!}
        </nav>
      </div>
    </div>
  </div>

@endsection

@section('body_attributes')
  data-spy="scroll"
@endsection
